<template>
  <div>
    <el-dialog
      top="40vh"
      :visible.sync="visible"
      @close="$emit('update:show', false)"
      :show="show"
      width="20%"
    >
      <!-- 商品已成功加入购物车 -->
      <span>
        <slot name="title"></slot>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  data() {
    return {
      visible: this.show
    };
  },
  props: {
    show: {
      type: Boolean,
      default: false
    }
  },
  watch: {
    show() {
      this.visible = this.show;
    }
  }
};
</script>

<style>
.el-dialog {
  width: 260px;
  height: 130px;
  /* background: #F03A58 !important;  */
  border-radius: 10px !important;
  display: flex;
  align-items: center;
  justify-content: center;
}
.el-dialog span {
  display: flex;
  align-items: center;
}
.el-dialog span img {
  margin-right: 6px;
}
.el-dialog__header {
  padding: 0 !important;
}
.el-dialog__body {
  margin-left: 16px;
  color: black !important;
  font-weight: bold !important;
  letter-spacing: 2px !important;
  font-size: 16px !important;
}
.el-dialog__close {
  /* opacity: 0 !important; */
  font-weight: bolder !important;
}
</style>
